package com.imooc.springcloud;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @describte:负载均衡策略配置
 * @program:spring-cloud-demo
 * @author:zhengdp
 * @create:2021-10-01 12:03:14
 **/
@Configuration
@RibbonClient(name = "eureka-client",configuration = com.netflix.loadbalancer.RandomRule.class)
public class RibbonConfiguration {
    /**
     * 自定义 Ribbon的默认负载均衡策略
     * 全局配置
     * @return
     */
    /*@Bean
    public IRule defaultLBStrategy(){
        return new RandomRule();
    }*/
}
